package com.jicheng.mapper;

import com.jicheng.entity.task.Attachment;
import com.jicheng.framework.mybatis.mapper.BaseMapper;
import io.swagger.annotations.ApiModel;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

@Repository
public interface AttachmentMapper extends BaseMapper<Attachment> {
    @Select("select count(1) from tb_attachment where id = #{attachmentId}")
    int checkAttachment(@Param("attachmentId") String attachmentId);

    @Update("update tb_attachment set deleted = 0 where #{where} = #{id}")
    void del(@Param("where") String where, @Param("id") String id);
    @Select("select count(1) from tb_attachment where id = #{attachmentId} ")
    int isExist(@Param("attachmentId") String attachmentId);
}
